package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

public class IODemo9 {
    public static void main(String[] args) {
        //使用OutputStream 写文件
        try (OutputStream outputStream = new FileOutputStream("./test.txt",true)){//从这里打开文件就会覆盖原先文件里面的内容,append参数就是追加的意思
           byte[] buffer = new byte[] {98,99,100,101};
           outputStream.write(buffer);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
